home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr13 / aurora2c.zip / MOUSE.AML < prev    next >
Text File  |  1995-04-07  |  5KB  |  231 lines

  1.  
  2. // ───────────────────────────────────────────────────────────────────
  3. // The Aurora Editor v2.0
  4. // Copyright 1993-1995 nuText Systems. All Rights Reserved Worldwide.
  5. //
  6. // Mouse definitions (included by MAIN.AML)
  7. //
  8. // If you have made any changes, save this file and select 'Recompile
  9. // the Editor' <alt f2> from the Set menu. Exit and re-enter the
  10. // editor for your changes to take effect.
  11. // ───────────────────────────────────────────────────────────────────
  12.  
  13. // ───────────────────────────────────────────────────────────────────
  14. //  Edit and File Manager windows
  15. // ───────────────────────────────────────────────────────────────────
  16.  
  17.   object edit_fmgr
  18.  
  19.   // left button down
  20.   function  <lbutton>
  21.     if button? 2 then
  22.       queue <chord>
  23.     else
  24.       pass
  25.     end
  26.   end
  27.  
  28.   // right button down
  29.   function  <rbutton>
  30.     if button? 1 then
  31.       queue <chord>
  32.     else
  33.       case getregion
  34.         when 1
  35.           gotomenu
  36.         when 11, 12
  37.           open "*.*"
  38.         otherwise
  39.           pass
  40.       end
  41.     end
  42.   end
  43.  
  44.   // left & right button down (mouse chording)
  45.   function  <chord>
  46.   end
  47.  
  48.   // left button double-click
  49.   function  <ldouble>
  50.  
  51.     case getregion
  52.  
  53.       // background
  54.       when ''
  55.         winlist
  56.  
  57.       // title bars
  58.       when 11, 12
  59.         if max? or min? then
  60.           restore
  61.         else
  62.           maximize
  63.         end
  64.  
  65.       otherwise
  66.         pass
  67.     end
  68.   end
  69.  
  70.  
  71. // ───────────────────────────────────────────────────────────────────
  72. //  Prompts and Edit windows
  73. // ───────────────────────────────────────────────────────────────────
  74.  
  75.   object  prompt
  76.  
  77.   // left button down
  78.   function  <lbutton>
  79.     // pass on to the library (lib.x)
  80.     pass
  81.     // library may switch windows, so check...
  82.     if wintype? "prompt" then
  83.       _lbf =''
  84.       case getregion
  85.         // retrieve tab
  86.         when 14
  87.           askhistory
  88.         // left title
  89.         when 13
  90.           call <lbuttonup>
  91.           close
  92.         // client area
  93.         when 1
  94.           // set flag for mouse marking
  95.           _lbf = 1
  96.           trackmouse
  97.       end
  98.     end
  99.   end
  100.  
  101.   // move mouse
  102.   function  <move>
  103.     if _lbf then
  104.  
  105.       // mouse marking
  106.       if _lbf == 1 then
  107.         destroymark
  108.  
  109.         // get the mark type from the keyboard shift-state or the
  110.         // MouMark config variable
  111.         mark_type = shiftkey? 0Fh
  112.         if not mark_type then
  113.           mark_type = case _MouMark
  114.                         when 'k'  4h
  115.                         when 'l'  8h
  116.                         otherwise 1h
  117.                       end
  118.         end
  119.  
  120.         case mark_type
  121.           when 4h    markcolumn
  122.           when 8h    markline
  123.           otherwise  markstream
  124.         end
  125.         _lbf = 2
  126.       end
  127.       trackmouse
  128.     else
  129.       pass
  130.     end
  131.   end
  132.  
  133.   // left button up
  134.   function  <lbuttonup>
  135.     if _lbf then
  136.       stopmark
  137.       _lbf = ''
  138.     end
  139.     pass
  140.   end
  141.  
  142.  
  143. // ───────────────────────────────────────────────────────────────────
  144. //  Edit windows
  145. // ───────────────────────────────────────────────────────────────────
  146.  
  147.   object edit
  148.  
  149.   // left button double-click
  150.   function  <ldouble>
  151.     case getregion
  152.       when 1
  153.         destroymark
  154.         case _MouMarkD
  155.           when 'k'   markcolumn
  156.           when 's'   markstream
  157.           otherwise  markline
  158.         end
  159.         setobj _lbf 2 "prompt"
  160.       otherwise
  161.         pass
  162.     end
  163.   end
  164.  
  165.   // left button triple-click
  166.   function <ltriple>
  167.     case getregion
  168.       when 1
  169.         markword
  170.     end
  171.   end
  172.  
  173.  
  174. // ───────────────────────────────────────────────────────────────────
  175. //  File Manager windows
  176. // ───────────────────────────────────────────────────────────────────
  177.  
  178.   object  fmgr
  179.  
  180.   // double click to open
  181.   function  <ldouble>
  182.     _lbf = ''
  183.     case getregion
  184.       when 1
  185.         fopen '1'
  186.       otherwise
  187.         pass
  188.     end
  189.   end
  190.  
  191.   // left button down
  192.   function  <lbutton>
  193.     // pass on to the library (lib.x)
  194.     pass
  195.     // library may switch windows, so check...
  196.     if wintype? "fmgr" then
  197.       if getregion == 1 then
  198.         _lbf = 1
  199.         trackmouse
  200.         // toggle file mark if <ctrl> is pressed
  201.         if shiftkey? 4h then
  202.           fmark
  203.         end
  204.       else
  205.         _lbf = ''
  206.       end
  207.     end
  208.   end
  209.  
  210.   // mouse move
  211.   function  <move>
  212.     y = getmousey 'e'
  213.     if _lbf and (button? 1h) then
  214.       if shiftkey? and y <> _lasty then
  215.         fmark
  216.       end
  217.       _lasty = y
  218.       trackmouse
  219.     else
  220.       _lbf = ''
  221.       pass
  222.     end
  223.   end
  224.  
  225.   // left button up
  226.   function  <lbuttonup>
  227.     _lbf = ''
  228.     pass
  229.   end
  230.  
  231.